﻿CREATE PROCEDURE [dbo].[proc_Customer_Apply_GetList]
	(
		@UserName nvarchar(50)
	)
AS
	Select 
		Id,
		CustomerId,
		CustomerName,
		DepartmentId,
		(Select d.DName From Department d Where d.Id=DepartmentId) as DepartmentName,
		UserName,
		CreateDate
	From
		Customer_Apply
	Where
			UserName = @UserName
		And	Convert(nvarchar(7),CreateDate,120) = Convert(nvarchar(7),GetDate(),120)
	RETURN
